package com.vhall.component.entity.gift.vo;


import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author xianglei
 * @date 2021/3/10
 */
@Data
public class MapSaveReqVo implements Serializable {

    private static final long serialVersionUID = -4182388274875854660L;

    /**
     * 创建者ID
     */
    @ParamName("creator_id")
    @Length(max = 30, message = "creator_id最大长度不能超过30")
    private String creatorId;


    /**
     * 来源ID
     * 默认为0
     */
    @ParamName("room_id")
    @Length(max = 30, message = "room_id长度不能超过30")
    private String roomId = "0";

    /**
     * 表情ID，多个ID以逗号分割
     */
    @ParamName("gift_ids")
    @NotBlank(message = "表情ID不能为空")
    @Pattern(regexp = "^(?!,)[\\d,]*(?<!,)$", message = "gift_ids参数错误，请传入正确的格式，多个Id请以逗号分割，且不以逗号开始或者结尾")
    private String giftIds;

    /**
     * 关联类型：0 关联来源ID，1 关联创建者ID
     */
    @NotNull(message = "关联类型不能为空")
    @Range(min = 0, max = 1, message = "type只能为0或者1")
    private Integer type;
}
